<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$setting.webname}-我的</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <link rel="shortcut icon" href="/public/static/admin/uploads/set/{$setting['ico']}">
    <link type="text/css" rel="stylesheet" href="/public/static/home/themes/css/base.css">
    <link type="text/css" rel="stylesheet" href="/public/static/home/themes/css/home.css">
    <script type="text/javascript" src="/public/static/home/themes/js/jquery.min.js"></script>
    <script type="text/javascript" src="/public/static/home/themes/js/slider.js"></script>
    <script type="text/javascript" src="/public/static/home/themes/js/tab.js"></script>
    <style>
        .gj{
            display: none;
        }
    </style>

</head>
<body>

<section class="aui-flexView">
    <header class="aui-navBar aui-navBar-fixed b-line">
        <!--<a href="search.html" class="aui-navBar-item">-->
        <!--    <i class="icon icon-search"></i>-->
        <!--</a>-->

        <div class="aui-center">
            <span class="aui-center-title">我的</span>
        </div>
        <!--<a href="notice.html" class="aui-navBar-item">-->
        <!--    <i class="icon icon-news"></i>-->
        <!--</a>-->
    </header>
    <section class="aui-scrollView">
        <div class="aui-well-comm">
            <div class="aui-well-comm-hd">
                {if condition="preg_match('/base64/',$user.photo) > 0"}
                <a href="{:url('set/header_photo')}"><img src="{$user.photo}" alt=""></a>
                {else /}
                <a href="{:url('set/header_photo')}"><img src="/public/static/admin/uploads/teacher_photo/{$user.photo}" alt=""></a>
                {/if}
                <!--<span class="aui-well-comm-vip">-->
                <!--    <img src="/public/static/home/themes/img/icon/icon-vip.png" alt="">-->
                <!--</span>-->
            </div>
            <div class="aui-well-comm-bd">
                <h4>
                    <span>{$user.name}</span>
                    {if condition="$user.sex==0"}<i class="icon icon-man"></i>{else /}<i class="icon icon-"></i>{/if}

                </h4>
                <p> {if condition="!empty($user.motto)"}<a href="{:url('set/signatrue')}" style="color:#fff">{$user.motto}</a>{else /}<a href="{:url('set/signatrue')}" style="color:#fff">个性签名</a>{/if}</p>
            </div>
            <!--<span class="aui-comm-sign">已签到</span>-->
        </div>
        <div class="aui-grids">
            <a href="{:url('My/student_type')}?id={$user.id}&type=5" class="aui-grids-item">
                <span>{$my_count.xxdsh}</span>
                <span class="aui-grids-item-text">信息待审核</span>
            </a>
            <a href="{:url('My/student_type')}?id={$user.id}&type=4" class="aui-grids-item">
                <span>{$my_count.dzf}</span>
                <span class="aui-grids-item-text">待支付</span>
            </a>
            <a href="{:url('My/student_type')}?id={$user.id}&type=1" class="aui-grids-item">
                <span>{$my_count.jfdsh}</span>
                <span class="aui-grids-item-text">缴费待审核</span>
            </a>
            <a href="{:url('My/student_type')}?id={$user.id}&type=2" class="aui-grids-item">
                <span>{$my_count.lq}</span>
                <span class="aui-grids-item-text">已录取</span>
            </a>
        </div>
        <div class="divHeight"></div>
        <div class="aui-grids aui-grids-image">
            <a href="javaScript:my_teacher_count()" class="aui-grids-item">
                <span>
                    <img src="/public/static/home/themes/img/icon/icon-user2.png" alt="">
                </span>
                <span class="aui-grids-item-text">我的组员</span>
            </a>
            <a href="{:url('My/my_student')}?id={$user.id}" class="aui-grids-item">
                <span>
                    <img src="/public/static/home/themes/img/icon/icon-user.png" alt="">
                </span>
                <span class="aui-grids-item-text">我的学生</span>
            </a>
            <a href="{:url('Set/index')}" class="aui-grids-item">
                <span>
                    <img src="/public/static/home/themes/img/icon/icon-key.png" alt="">
                </span>
                <span class="aui-grids-item-text">修改密码</span>
            </a>
            <a href="{:url('Set/share')}" class="aui-grids-item">
                <span>
                    <img src="/public/static/home/themes/img/icon/icon-p.png" alt="">
                </span>
                <span class="aui-grids-item-text">设置分享</span>
            </a>
            <a href="JavaScript:share();" class="aui-grids-item">
                <span>
                    <img src="/public/static/home/themes/img/icon/icon-share.png" alt="">
                </span>
                <span class="aui-grids-item-text">分享</span>
            </a>
            <a href="{:url('Login/exits')}" class="aui-grids-item">
                <span>
                    <img src="/public/static/home/themes/img/icon/icon-close.png" alt="">
                </span>
                <span class="aui-grids-item-text">退出</span>
            </a>
        </div>
        <div class="divHeight"></div>
        <a href="{:url('My/qrcode')}">
            <div class="aui-head-access b-line">
                <div class="aui-head-access-hd">我的微信二维码</div>
                <span class="fa fa-qrcode" style="margin-right:15px;"></span>
                <span class="aui-head-access-fr"></span>
            </div>
        </a>
        <a href="{:url('My/qr_src')}">
            <div class="aui-head-access b-line">
                <div class="aui-head-access-hd">我的招生二维码</div>
                <span class="fa fa-qrcode" style="margin-right:15px;"></span>
                <span class="aui-head-access-fr"></span>
            </div>
        </a>
        <div class="divHeight gj"></div>
        <div class="aui-head-access gj">
            <div class="aui-head-access-hd">我与我的组员共计</div>
        </div>
        <div class="aui-grids gj">
            <a  class="aui-grids-item">
                <span>{$all_count.xxdsh}</span>
                <span class="aui-grids-item-text">信息待审核</span>
            </a>
            <a class="aui-grids-item">
                <span>{$all_count.dzf}</span>
                <span class="aui-grids-item-text">待支付</span>
            </a>
            <a  class="aui-grids-item">
                <span>{$all_count.jfdsh}</span>
                <span class="aui-grids-item-text">缴费待审核</span>
            </a>
            <a class="aui-grids-item">
                <span>{$all_count.lq}</span>
                <span class="aui-grids-item-text">已录取</span>
            </a>
        </div>

        {foreach $myteachercount as $key=>$val}
        <div class="divHeight"></div>
        <div class="aui-head-access">
            <div class="aui-head-access-hd">{$val.name}</div>
        </div>
        <div class="aui-grids">
            <a href="{:url('My/student_type')}?id={$val.id}&type=5" class="aui-grids-item">
                <span>{$val.count.xxdsh}</span>
                <span class="aui-grids-item-text">信息待审核</span>
            </a>
            <a href="{:url('My/student_type')}?id={$val.id}&type=4" class="aui-grids-item">
                <span>{$val.count.dzf}</span>
                <span class="aui-grids-item-text">待支付</span>
            </a>
            <a href="{:url('My/student_type')}?id={$val.id}&type=1" class="aui-grids-item">
                <span>{$val.count.jfdsh}</span>
                <span class="aui-grids-item-text">缴费待审核</span>
            </a>
            <a href="{:url('My/student_type')}?id={$val.id}&type=2" class="aui-grids-item">
                <span>{$val.count.lq}</span>
                <span class="aui-grids-item-text">已录取</span>
            </a>
        </div>
        {/foreach}

        <div class="divHeight"></div>
    </section>
{include file="public/footer3"}
</section>

<script src="/public/static/home/js/jquery.min.js"></script>
<script src="/public/static/admin/layui/layui.js"></script>

<script>
    layui.use('upload', function() { //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer, upload = layui.upload; //独立版的layer无需执行这一句

        $.post("{:url('My/get_my_teacher_count')}",{},function(data){
            if(data.c > 0){
               $(".gj").show()

            }
        })
        window.my_teacher_count = ()=>{
            $.post("{:url('My/get_my_teacher_count')}",{},function(data){
                console.log(data.c);
                if(data.c > 0){
                    location.href = "{:url('My/myteacher')}"
                }else{
                    layer.msg("您还没有组员",{time:2000,shade:0.8});
                }
            })
        }
        //分享
        window.share = () =>{
            var adv_str = `{$user.adv_str}`
            var adv_href = `{$user.adv_href}`
            if(adv_href == "" || adv_str == ""){
                layer.msg("请设置分享地址和分享文案",{time:2000,shade:0.8})
            }else{
                copyText(adv_str);
                window.location = adv_href
            }
        }

    });
    //复制文本
    function copyText(text){
        var textareaC = document.createElement('textarea');
        textareaC.setAttribute('readonly', 'readonly'); //设置只读属性防止手机上弹出软键盘
        textareaC.value = text;
        document.body.appendChild(textareaC); //将textarea添加为body子元素
        textareaC.select();
        var res = document.execCommand('copy');
        document.body.removeChild(textareaC);//移除DOM元素
        console.log("复制成功");
        return res;
    }
</script>
</body>
</html>